import sys

from log_parser import LogParser

log = LogParser().ParseFile(sys.argv[1])

total_long = 0
for command in log:
    duration = command['end'] - command['start']
    if duration > 1000:
        print 'Command %s took %s ms' % (command['command'], duration)
        total_long += duration

print 'Total >1000ms: %s' % total_long
